package Com.Isman.Booking;

import Com.Isman.FinalVariable;
import Com.Isman.Location.LocationBase;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.location.Location;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class PageMain extends Activity {
   
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.pagemain);
        
        findLocation();

        
        
        Button vrb = (Button)findViewById(R.id.btnGoHotel);
        vrb.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				Intent intent = new Intent(arg0.getContext(), PageSearchHotel.class);
				arg0.getContext().startActivity(intent);
			}
		});
        
    }       
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
	    MenuInflater inflater = getMenuInflater();
	    inflater.inflate(R.menu.menumain, menu);
	    return true;
    }
    private void findLocation(){
        Location local = new LocationBase(this).GetLocation();
        
        SharedPreferences setting = getSharedPreferences(FinalVariable.APP_PREFERENCES,0);
        SharedPreferences.Editor edit = setting.edit();
//        edit.putFloat(FinalVariable.APP_LOCATION_LATITUBE, (float) local.getLatitude());
//        edit.putFloat(FinalVariable.APP_LOCATION_LONGITUBE,(float) local.getLongitude());
//        edit.commit();
    }
}